/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.sadhar.sipp.kendaraan;

import java.util.Map;
import org.sadhar.errhandler.ClassAntiNull;
import org.zkoss.zul.Listbox;
import org.sadhar.sia.framework.ClassApplicationModule;

import org.zkoss.zul.Label;
import org.zkoss.zul.Textbox;
import org.zkoss.zul.Window;

/**
 *
 * @author Yohan Hardinugroho
 */
public class KendaraanPopupOnPerekamanAnggaranBiayaUnitNonRapatKerjaWnd extends ClassApplicationModule {

    private Textbox txtboxKendaraanSearch;
    private Listbox lstboxKendaraan;

    public KendaraanPopupOnPerekamanAnggaranBiayaUnitNonRapatKerjaWnd() {
    }

    public void onCreate() throws Exception {
        lstboxKendaraan = (Listbox) getFellow("lstboxKendaraan");
        txtboxKendaraanSearch = (Textbox) getFellow("txtboxKendaraanSearch");

    }

    public void lstboxKendaraanOnSelect() throws Exception {
        Window w = (Window) this.getParent();

        Textbox txtboxIdSubItem = (Textbox) w.getFellow("txtboxIdSubItem");

        Textbox txtboxSubItemSearch = (Textbox) w.getFellow("txtboxSubItemSearch");
        Label lblSubitem = (Label) w.getFellow("lblSubitem");

        Map m = (Map) lstboxKendaraan.getSelectedItem().getValue();

        txtboxIdSubItem.setValue(ClassAntiNull.AntiNullIntString(m.get("kodeKendaraan")));
        txtboxSubItemSearch.setValue(ClassAntiNull.AntiNullString(m.get("noSTNK")));
        lblSubitem.setValue(ClassAntiNull.AntiNullString(m.get("namaMerkBarangInvestasi")));

        this.detach();
    }
}
